/**
 * 思维链演示的API包装
 * 基于@ant-design/x的XRequest实现
 */

import { XRequest } from "@ant-design/x";
import { THINKING_CHAIN_CONFIG } from "./apiService";

export interface ThinkingChainRequestParams {
  question: string;
  overrideConfig?: any;
  chatId?: string;
  streaming?: boolean;
}

/**
 * 创建思维链请求实例
 */
export function createThinkingChainRequest(chatId?: string) {
  const baseURL = chatId
    ? `${THINKING_CHAIN_CONFIG.BASE_URL}/${chatId}`
    : `${THINKING_CHAIN_CONFIG.BASE_URL}/${THINKING_CHAIN_CONFIG.CHAT_ID}`;

  return XRequest({
    baseURL,
  });
}

export default {
  createThinkingChainRequest,
  THINKING_CHAIN_CONFIG,
};
